Draw line on leaflet playback map instead of circle · Issue #44 · hallahan/LeafletPlayback · GitHub

您所在的位置:网站首页 leaflet map reload Draw line on leaflet playback map instead of circle · Issue #44 · hallahan/LeafletPlayback · GitHub

Draw line on leaflet playback map instead of circle · Issue #44 · hallahan/LeafletPlayback · GitHub

2023-04-19 09:33| 来源: 网络整理| 查看: 265

I need to draw line on leaflet playback map instead of circle, i try following code but didn't work well.

L.Playback = L.Playback || {};

L.Playback.TracksLayer = L.Class.extend({ initialize: function (map, options) { var layer_options = options.layer || {};

if (jQuery.isFunction(layer_options)) { layer_options = layer_options(feature); } if (!layer_options.pointToLayer) { layer_options.pointToLayer = function (featureData, latlng) { //return new L.polyline(latlng, { radius: 5 }); **return new L.polyline(latlng, { color: 'red', weight: 3, opacity: 0.5, smoothFactor: 1 }); };** } this.layer = new L.GeoJSON(null, layer_options); var overlayControl = { 'GPS Tracks': this.layer }; L.control.layers(null, overlayControl, { collapsed: false }).addTo(map); }, // clear all geoJSON layers clearLayer: function () { for (var i in this.layer._layers) { this.layer.removeLayer(this.layer._layers[i]); } }, // add new geoJSON layer addLayer: function (geoJSON) { this.layer.addData(geoJSON); }

}); My Json coords are below,

var tillicum=[{'type': 'Feature','geometry': {'type': 'MultiPolygon','coordinates': [ [ 79.825108,11.958093 ],[ 79.826233,11.957887 ],[ 79.826267,11.957808 ], ] }, 'properties': { 'title': 'tillicum', 'path_options': { 'color': 'red' }, 'time':[ 1468905535000,1468905595000,1468905597000,],'speed':[13.5023626],'altitude':[158.33] },}]



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3